<template >
    <div>
        <button @click="getStudent">获取学生信息</button><br/>
        <button @click="getCar">获取汽车信息</button>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    name:'App',
    methods: {
        getStudent(){
            axios.get('http://localhost:8080/lining/students').then(
                response =>{
                    console.log('请求成功了',response.data)
                },
                error =>{
                    console.log('请求失败了',response.msg)
                }
            )
        },
        getCar(){
            axios.get('http://localhost:8080/demo/cars').then(
                response=>{
                    console.log('请求成功了',response.data)
                },
                error=>{
                    console.log('请求失败了',response.msg)
                }
            )
        }
    },
}
</script>
